package com.willie.boot.controller;

import com.willie.boot.service.DeptService;
import com.willie.boot.vo.Dept;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * ----------------------------------------------
 * <p>类    名：</p>
 * <p>版    权：copyright© firegy.willie</p>
 * <p>作    者: liang</p>
 * <p>创建时间: 2018/8/29 15:15</p>
 * <p>描    述: </p>
 * <p>修 改 人：</p>
 * <p>修改时间：</p>
 * -----------------------------------------------
 */
@RestController
@RequestMapping("dept")
public class DeptController {
    @Resource
    private DeptService deptService;

    @ApiOperation("查询全部")
    @GetMapping("/getAll")
    public List<Dept> index() {
        return deptService.findAll();
    }

    @GetMapping("/queryDeptByDeptno")
    public Dept queryDeptByDeptno(Long deptno) {
        return deptService.findDeptByDeptno(deptno);
    }
}
